package com.erclab.xpresso.formelements
{
	import mx.controls.TextInput;
	import mx.controls.Label;
	import mx.core.UIComponent;
	import mx.controls.ComboBox;

	public class DropDown extends mx.controls.ComboBox implements FormElement
	{
		
		protected var destinationColumn:String;
		
		public function getValue():String
		{
			return String(this.selectedItem.id);
		}
		
		public function getName():String
		{
			return String(this.name);
		}
		
		public function createLabel(attachingElement:UIComponent, label:String):void{
			var myLabel:mx.controls.Label = new mx.controls.Label();
			myLabel.x = this.x - 100;
			myLabel.y = this.y;
			myLabel.text = label;
			attachingElement.addChild(myLabel);
			
		}
		
		public function setValue(value:String):void {
			this.text = value;
		}
		
		public function getAttribute(attribute:String):String{
			return this[attribute];
		}
		
		public function setAttribute(attribute:String, attributeValue:String):void{
			if (attribute == 'contenturl'){
				
			} else {
				this[attribute] = attributeValue;
			}
		}

		public function prepareForInsert():void{
			this.text = "";
		}
	}
}